using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class JoyClass : MonoBehaviour
{
    public GameObject joy;
    // Start is called before the first frame update
    void Start()
    {
        
    }
    bool felg = false;
    float time = 0;
    int count = 0;
    // Update is called once per frame
    void Update()
    {
        if(Input.GetMouseButtonDown(0))
        {
            joy.gameObject.SetActive(true);
        }
        if(Input.GetMouseButtonUp(0))
        {
            count++;
            if(count==2)
            {
                felg = true;
                count = 0;
            }
        }
        if(felg)
        {
            time += Time.deltaTime;
            if (time >= 1)
            {
                time = 0;
                felg = false;
                joy.gameObject.SetActive(false);
            }
        }
    }
}
